﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using DevExpress.XtraEditors;

namespace TMIS
{
    public partial class frmRecommend : frmCommon
    {
        private Guid guid;
        private BLL.Recommend bll = new BLL.Recommend();
        public frmRecommend()
        {
            InitializeComponent();
        }
        public frmRecommend(Guid guid)
        {
            this.guid = guid;
            InitializeComponent();
            this.FillComponent();
        }
        private void FillComponent()
        {
            this.recommendTableAdapter.FillByStudentID(this.reportDS.Recommend, guid);
            this.reportViewer.RefreshReport();
            Model.Recommend rec = new Model.Recommend()
            {
                ID = this.guid,
                Opinion = bll.Get(guid)
            };
            txtOpinion.Text = rec.Opinion;
        }
        private void frmRecommand_Load(object sender, EventArgs e)
        {
        }
        public override void Save()
        {
            Model.Recommend rec = new Model.Recommend()
            {
                ID = this.guid,
                Opinion = txtOpinion.Text
            };
            bll.Update(rec);

        }
        public override void Priview()
        {
            this.recommendTableAdapter.FillByStudentID(this.reportDS.Recommend, guid);
            this.reportViewer.RefreshReport();
        }
    }
}
